﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="treeview.aspx.cs" Inherits="Ecreate.Web.systemanage.productclass.treeview" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
       <style type="text/css">
            #tree 
            {
	            padding:0 0 0 43px;  height:100px;
	        }
            div.divScroll{
				            PADDING-RIGHT:0px; 
				            PADDING-LEFT: 0px;
				            PADDING-BOTTOM: 0px;
				            PADDING-TOP: 5px; 
				            WIDTH: 100%;
				            HEIGHT: 100%;
			             }	        
	        li
	        {
	        	font-size:12px;
        		color:#555E7B;
	        }
       </style>
       <link rel="stylesheet" type="text/css" href="/content/javascript/XTree25/dhtmlXTree.css"/>   
       <script type="text/javascript"  src="/content/javascript/jquery/jquery-1.3.2.js" ></script>
       <script type="text/javascript" src="/content/javascript/XTree25/dhtmlXCommon.js"></script>
	   <script type="text/javascript" src="/content/javascript/XTree25/dhtmlXTree.js"></script>	
       <script type="text/javascript" language="javascript">
           function tree_productOnclick(nodeId) {
               var level = tree_productclass.getUserData(nodeId, "level");
               if (typeof (level) == "undefined" || level == "") return;
               var str_addchildnode = "<a href='/systemanage/productclass/addproductclass.aspx?type=addchildnode&classid=" + nodeId + "' target='productclassDtlIframe'>添加产品次类别</a>";
               var str_delchild = "<a href='?type=del&classid=" + nodeId + "'     target='_self'>删除产品类别</a>";
               var str_addroot = "<a href='/systemanage/productclass/addproductclass.aspx?type=addroot'   target='productclassDtlIframe'>添加产品大类</a>";
               var str_updatenode = "<a href='/systemanage/productclass/addproductclass.aspx?type=updatenode&classid=" + nodeId + "'     target='productclassDtlIframe'>更新产品类别名称</a>";
               $("#div_addroot").html(str_addroot);
               //$("#div_updatenode").html(str_updatenode);
               if (level == "1") {
                   $("#div_addchildnode").html("添加产品次类别");
                   $("#div_deletenode").html(str_delchild);
               }
               if (level == "0") {
                   $("#div_addchildnode").html(str_addchildnode);
                   $("#div_deletenode").html(str_delchild);
               }             
           }
           function viewRight(id){   
               alert(id);   
           }
           function createTree() {
               tree_productclass = new dhtmlXTreeObject("tree_product", "100%", "100%", 0);
               tree_productclass.setSkin('dhx_skyblue');
               tree_productclass.setImagePath("/content/javascript/XTree25/imgs/csh_bluefolders/");
               var xml = "<%=str_xml%>";
               tree_productclass.setOnClickHandler(tree_productOnclick);
               tree_productclass.loadXMLString(xml);
           }
           $(document).ready(function() {
                 createTree();
                 var str_addroot = "<a href='/systemanage/productclass/addproductclass.aspx?type=addroot'   target='productclassDtlIframe'>添加产品大类</a>";
                 $("#div_addroot").html(str_addroot);
           });
    </script>
</head>
<body >
    <form id="form1" runat="server">
            <div id="tree_product" class="divScroll">
            </div>	
            <div id="footer">
                <ul>
                    <li id="div_addroot">添加产品大类
                    </li>
                    <li id="div_addchildnode">添加产品次类别
                    </li>
                    <li id="div_deletenode">删除产品类别
                    </li>      
<%--                     <li id="div_updatenode">更新产品类别名称
                    </li> --%>                                                       
                </ul>
            </div>
    </form>
</body>
</html>